Skip to content

fix(windows): inspect finding receipts through extended paths - #2386

Open
sylvesterkaczmarek wants to merge 13 commits into
openai:mainfrom
sylvesterkaczmarek:fix/windows-receipt-inspection-long-paths
Open

sylvesterkaczmarek wants to merge 13 commits into
openai:mainfrom
sylvesterkaczmarek:fix/windows-receipt-inspection-long-paths

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #2378. When the state directory fits within the legacy Windows path limit but its database filename crosses it, inspection can miss an existing finding receipt store.

Changes

Use the existing Windows extended-path conversion for the history existence check and the read-only SQLite URI. When the prefix alone would exceed the default Win32 SQLite filename budget, keep the ordinary filename in the URI. The test suite exercises drive and UNC spelling and reads a real long-path database through the workbench command on Windows. Existing tests cover missing stores, permission errors and inspection without migration.

The native Windows suite also exercises a 1,030-byte drive filename. It first opens the ordinary filename read-only as a control, then checks the workbench receipt, database bytes and directory entries. The Ubuntu inventory fixture includes the env utility name correction from #2678.

Testing

  • On upstream main, four emulated drive and UNC cases observed the ordinary filename at both the stat and SQLite boundaries.
  • On the updated head, the complete receipt module passed on Linux (23 passed, three native Windows skips). Ruff lint and format, the SDK CI build, the plugin source compatibility check and its nine Node tests passed.
  • Two new multibyte drive and UNC regression cases failed on the prior PR head and passed after the correction. A separate Linux workbench probe used SQLite's real pager with a simulated 1,040-byte Win32 VFS. For a 1,030-byte ordinary filename the previous head exited 73 before opening the store. Both the corrected head and main read the seeded receipt.
  • On the updated head, the Windows Server 2025 / Python 3.12 job passed. Its JUnit report records successful native reads for ordinary and extended inputs at the legacy boundary and an ordinary 1,030-byte drive filename. All 651 reported cases, including subtests, passed with zero skips.
  • The contributor previously observed four failing assertions before the fix on macOS. Independent native Windows x64 validation on an earlier revision reported 28 passes and four skips, including both native long-path cases. Hosted Windows checks on an earlier head also passed.

Risk and rollout

Writable SQLite connections and migrations retain their existing behavior. The Linux run covers UNC spelling through a test double. Live UNC access and an enforced legacy Windows policy remain unverified.

Public disclosure review

The existing checklist records review of the preceding revision. For this update, the branch, title, PR text, public discussion, links, commit metadata and cumulative diff were reviewed.

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the bug Something isn't working label Nov 6, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T06:26:52.835360Z 9b6cacb New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 8d814f3124

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Collaborator

Both native long-path cases passed on Windows. The source check failed because the POSIX-only filename case was selected and skipped. The updated test selection keeps that case on Unix and keeps the native receipt checks on Windows.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 9be5600cdc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

CI note for current head 668df43: the native bundle gate failed because its upstream Unix artifact result was reported as abandoned (PREPARE_RESULT=success, WINDOWS_RESULT=success, MUSL_RESULT=success). The overall ci gate consequently failed; this run has no receipt-test assertion failure to address. I tried a failed-job rerun, but GitHub requires repository admin access. Could someone with access rerun the workflow when practical? Thanks, and happy to follow up on any reproducible failure.

@AmarGhugare

Copy link
Copy Markdown

Independent validation of PR #2386 at 70672d78d81b66835685a4da4fbc33d76e0d0e3a on native Windows x64 with Python 3.13.9 and SQLite 3.50.4.

Results:

  • Native Windows subset: 2 passed, 30 deselected.
  • Complete test_finding_issue_receipts.py module: 28 passed, 4 skipped. The two native cases are included in this total.

The native cases exercise ordinary and extended-length filename inputs for a database whose filename crosses 260 characters. They read the expected receipt and check that the database contents and directory entries remain unchanged.

Commands, run from the repository root with a fresh temporary directory for each invocation:

python -m pytest plugins/codex-security/tests/test_finding_issue_receipts.py -m native_windows -q
python -m pytest plugins/codex-security/tests/test_finding_issue_receipts.py -q

This provides an independent check of the current head alongside the earlier Windows results in this discussion. It does not establish that an ordinary long filename fails under legacy Windows policy, and no live UNC share was tested. No machine-wide long-path setting or repository source was changed.

@sylvesterkaczmarek

sylvesterkaczmarek commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @AmarGhugare for the independent native Windows checks and for clearly stating their limits. Great to have the two receipt cases and the whole module verified on Windows. @mldangelo-oai, thanks as well for the test and workflow follow-through. The current 2ffa49c head now has green hosted Windows checks and an overall green CI gate. I've updated the PR description to distinguish that result from Amar's earlier-head run. Appreciate the help!

@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review November 13, 2026 19:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows receipt inspection uses an ordinary filename for long workbench paths

4 participants